package controller.admin.shop;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import model.entity.Shop;
import service.Impl.ShopServiceImpl;
import util.GetJsonUtil;
import util.ResultUtil;

import java.io.IOException;

@WebServlet("/admin/shop/update")
public class ShopUpdateController extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Shop shop= (Shop) GetJsonUtil.get(req,new Shop());
        ShopServiceImpl shopService = new ShopServiceImpl();
        shopService.update(shop);
        String json= ResultUtil.getJSON(null);
        resp.getWriter().write(json);
    }
}
